package ren.colorful.learnjdk;

import java.util.HashMap;
import java.util.Map;

public class TestMap {
	private static Map<String, String> map = new HashMap<String,String>();
	
	public static void main(String[] args) throws InterruptedException {
		new Thread(new Runnable(){
			
			@Override
			public void run() {
				for(int i = 0; i < 10000; i++){
					map.put(String.valueOf(i), String.valueOf(i+2));
				}
				map.forEach((k,v) -> {
					System.out.println(v);
				});
			}
			
		}).start();
		new Thread(new Runnable(){

			@Override
			public void run() {
				for(int i = 0 ; i < 10000000 ; i ++){
					map.put(String.valueOf(i), String.valueOf(i+1));
				}				
			}
			
		}).start();
		
		Thread.sleep(1000L);
		
	}
}
